<!doctype html>
<include file="Public:header"/>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>Document</title>
		<link href="__PUBLIC__/Home/Css/search.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.8.3.js"></script>

		<script type="text/javascript">
			$(function(){
				/*添加到购物车Ajax*/
				$('.addCarts').click(function(){
					
					var fid = $(this).attr('alt');				
					var url = '__APP__/Carts/setCarts/';
					var nowobj = $(this);

					$.post(url,{id:fid},function(cdata){

						if('YES' == cdata.data){
	                                                	
		                                            		nowobj.text('已添加');
		                                        	}else if('NO' == cdata.data){
		                                        		nowobj.text('已存在');                   		
		                                        	}else{                                      		
		                                        		if(!confirm('您还没有登录,去登录吗?')){
	                                    				return false;
	                                				}
		                                        		window.location.href = "__APP__/Login/login";
		                                        	}

					});
				});
			});
		</script>		
	</head>
	<body>
		
		<div id="search_main">
			<div style="width:650px;height:500px;float:left;background:white;">
			<empty name="data">

			<else/>
			<table border="0" cellspacing="0" cellpadding="0">
				<volist name="data" id="vo">
					<tr>
						<td width="400">
							<{$i}>.
							<a href="__APP__/Foods/details/id/<{$vo.id}>" style="text-decoration:none;color:#992222;font-size:14px;">
								<font color="#B24422"><{$vo.name}></font>
							</a>
						</td>
						<td>
							价格：
							<font color="#B24422"><{$vo.price}>￥</font>
						</td>
					</tr>
					
					<td colspan="2">
						描述：<{$vo.describe|substr=0,60}>...
					</td>
					<tr>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</tr>
				</volist>
			</table>
			</empty>
			</div>
		<div id="search_right">
			<volist name="data" id="vo" offset="0" length='4'>
				<div class="advance">
					<a href="__APP__/Foods/details/id/<{$vo.id}>" target="__blank">
						<img src="__ROOT__/Uploads/Foods/thumb/th_<{$vo.pic}>" width="160" height="100" />
					</a>
				</div>	
				<div class="detail">
					<br />
					<a href="__APP__/Foods/details/id/<{$vo.id}>" target="__blank">
						<font color="#B24422"><{$vo.name}></font>
					</a>
					<p color="#B24422">价格：<{$vo.price}>￥</p>
					<a alt="<{$vo.id}>" class="addCarts">
						+购物车
					</a>
				</div>			
			</volist>			
		</div>		
		</div>
		<notempty name="page">
		<div id="search_page">
			共<{$page}>	
		</div>
		</notempty>
	</body>
</html>
<include file="Public:footer"/>